<template>
    <div>
        <a-modal
         v-model:visible="visibleShow" 
         title="下载控制" 
         @cancel="visibleShow = false"
         :width="600"
         :footer="null"
        >
            <div style="display: flex;justify-content: center;">
                <a-button class="blue-btn" type="primary" @click="stampedVersionClick(true)" icon="audit">设置成可下载</a-button>
                <a-button style="margin-left: 10px;" class="blue-btn" type="primary" @click="stampedVersionClick(false)" icon="audit">设置成不可下载</a-button>
            </div>
        </a-modal>
    </div>
</template>
<script>
import { spcyZltxwjBasicsetYxxz, spcyZltxwjBasicsetNotYxxz, } from './service/index'
export default {
    components:{

    },
    props:{

    },
    data(){
        return{
            visibleShow:false,
            currentData:{},
        }
    },
    watch:{

    },
    mounted(){
        
    },
    methods:{
        getData(row){
            this.currentData = row
        },
        stampedVersionClick(val){
            var that = this
            if(val){//受控项
                this.$confirm({
                    title:'确认要设置成可下载吗？',
                    onOk() {
                        spcyZltxwjBasicsetYxxz(that.currentData).then(res=>{
                            if(res.code == 200){
                                that.$message.success(res.message)
                                that.visibleShow = false
                                that.$emit('refreshSealFile')
                            }else{
                                that.$message.warning(res.message)
                            }
                        })
                    }
                })
            }else{
                this.$confirm({
                    title:'确认要设置成不可下载吗？',
                    onOk() {
                        spcyZltxwjBasicsetNotYxxz(that.currentData).then(res=>{
                            if(res.code == 200){
                                that.$message.success(res.message)
                                that.visibleShow = false
                                that.$emit('refreshSealFile')
                            }else{
                                that.$message.warning(res.message)
                            }
                        })
                    }
                })
            }
        },
    }
}
</script>
<style lang="less">

</style>